package com.zhonghui.common.eshopMapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhonghui.common.eshopDomain.StoreBargainUser;
import com.zhonghui.common.eshopVo.StoreBargainUserQueryVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface StoreBargainUserMapper extends CoreMapper<StoreBargainUser>  {
    @Select({"SELECT u.uid,u.is_del as isDel,u.bargain_price - u.price as residuePrice,u.id,u.bargain_id as bargainId,u.bargain_price as bargainPrice,u.bargain_price_min as bargainPriceMin,u.price,u.status,b.title,b.image,b.stop_time as datatime FROM store_bargain_user u INNER JOIN store_bargain b ON b.id=u.bargain_id WHERE u.uid = #{uid} AND u.is_del = 0 ORDER BY u.id DESC "})
    List<StoreBargainUserQueryVo> getBargainUserList(@Param("uid") Long uid, Page page);
}